package _thread_lock._threadpool._denypolicy;

import _thread_lock._threadpool.ThreadPool;

/**
 * @Author: huangya
 * @Date: 2020/10/14
 * @Description:
 */
public class AbortDenyPolicy implements DenyPolicy {

    /**
     * 该拒绝策略会向任务提交者抛出异常
     * @param runnable
     * @param threadPool
     */
    @Override
    public void reject(Runnable runnable, ThreadPool threadPool) {
        throw new RunnableDenyException("The runnable " + runnable + " will be abort. ");
    }
}
